package com.guigui.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.guigui.common.valid.AppointNumberValid;
import com.guigui.common.valid.BrandAddValidGroup;
import com.guigui.common.valid.BrandUpdateValidGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 品牌
 * 
 * @author xin
 * @email 806748502@qq.com
 * @date 2021-07-23 14:10:33
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "修改必须携带品牌id",groups = {BrandUpdateValidGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */

	@NotBlank(message = "品牌名不能为空",groups = {BrandUpdateValidGroup.class, BrandAddValidGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
//	@URL(message = "logo地址非法",groups = {BrandAddValidGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	@NotBlank(message = "介绍不能为空",groups = {BrandAddValidGroup.class})
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@AppointNumberValid(vals = {1,0},groups = {BrandAddValidGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@Pattern(regexp = "^[a-zA-Z]$",message = "必须是单个大小写英文字母",groups = {BrandAddValidGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */

	private Integer sort;

}
